<?php

	/**
	 * Workspace@ Engine application comment!
	 * 
	 * LICENSE
	 * This application is licensed under New BSD license.
	 * Please read complete LICENSE.txt inside of root folder for more details.
	 * 
	 * We wish you good building :) 
	 * 
	 * @category   Application
	 * @package    Bootstrap
	 * @author     Nevio Vesic <nevio@workspaceat.com>
	 * @copyright  2008-2009 Workspace@ group in association with Design strategist
	 */

	class Engine_Plugins_Css extends Engine_Application_Abstract
	{
		const CSS_PATH = "css";
		
		/**
		 * Get current theme path ( for css )
		 *
		 * @return string
		 */
		public function getCssPath()
		{
			return self::$system -> enviroment -> url  . self::CSS_PATH . "/" . 
				   self::$system -> css -> style . "/";
		}
		
		/**
		 * Load css template
		 *
		 * @param array $data
		 */
		public function load(Array $data )
		{
			$rdata = array();
			
			foreach ( $data as $item => $media )
			{
				if ( @self::$system -> css -> filename -> $item )
				{
					$rdata[$item]["url"] = $this->getCssPath() . self::$system -> css -> filename -> $item;
					
					if (! $media )
					{
						$rdata[$item]["media"] = "screen";
						
					}else
						$rdata[$item]["media"] = $media;
				}
			}
			
			$cssdata = new Zend_Config( $rdata );
			
			require_once "Css/css.phtml";
		}
	}

